#include "choosemode.h"
#include "ui_choosemode.h"

ChooseMode::ChooseMode(MyClientSocket * socket,handlemessage * handlemessage,QWidget *parent) :
    QWidget(parent),
    m_socket(socket),
    m_handlemessage(handlemessage),
    ui(new Ui::ChooseMode)
{
    ui->setupUi(this);
    m_mainWindow = NULL;
}

ChooseMode::~ChooseMode()
{
    delete ui;
}

void ChooseMode::on_playAiBtn_clicked()
{
    m_mainWindow = new MainWindow(m_socket,AI,NULL);
    m_mainWindow->show();
    this->hide();
}

void ChooseMode::on_playGamerBtn_clicked()
{
    m_mainWindow = new MainWindow(m_socket,GAMER,m_handlemessage);
    m_mainWindow->show();
    this->hide();
}
